
    <script type="text/javascript" src="jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="jquery.esn.autobrowse.js"></script>
    <script type="text/javascript" src="jquery.json-2.2.min.js"></script>
    <script type="text/javascript" src="jstorage.js"></script>
  	<link rel="stylesheet" type="text/css" media="all" href="infinite-scroll.css">   
  	 
    <script type="text/javascript">
        $(function () {
            $("#clear_cache").click( function (e) {
                e.preventDefault();
                $('.page .items').autobrowse('flush');
            })

            $(".page .items").autobrowse(
                {
                    url: function (offset)
                    {
                        //alert(offset );
                          //return "http://twitter.com/status/user_timeline/ParisHilton.json?count=10&page=OFFSET&callback=?".replace(/OFFSET/, 1+Math.round(offset/10));
                          
                          return "http://localhost/iclient/index.php?module=IShopStore&func=listJSON&type=ajax";
                    },
                    template: function (response)
                    {
                        var markup='';
                        for (var i=0; i<response.length; i++)
                        {
                            markup += '<div class="tweet">';
                            markup += '<img src="http://localhost/iclient/'+response[i].firstthumbname+'">';                            
                            markup += '<p><strong>' + response[i].item_ref_id+ ' : </strong>';
                            markup += '<p><strong>' + response[i].title + '</strong><br>';
                            markup += response[i].detail;
                            markup += '</p><div style="clear: both;"></div></div>';
                        }
                        return markup;
                    },
                    itemsReturned: function (response) { return response.length; },
                    max: 50,
                    sensitivity: 100,
                    finished: function () { $(this).append('<p style="text-align:center">Nothing more to show</p>') }
                }
            );
        });
    </script>    
</head>
<body>
<div class="page">
    <div style="clear: both;"></div>
    <h2>Infinite Scroll</h2>
    <div class="items">
    </div>
    <br>
    <a href="#clearcache" id="clear_cache">Clear cache</a>

</div>
</body>
</html>
